<template>
	<view>
		<CommentList :propsList="list" :page="page" :detailExcerpt="detailExcerpt"></CommentList>
	</view>
</template>

<script>
	import CommentList from '../../components/comment-list.vue'
	import ListOptions from '../../minxins/list-options.js'
	export default {
		data() {
			return {
				page: 'my-comment',
				detailExcerpt: true
			}
		},
		mixins: [ListOptions],
		components: {
			CommentList
		},
		async onLoad(options) {
			this.options = Object.assign({}, this.options, options)
			try {
				let result = await this.fetchPageData()
				this.renderPage(result)
				let user = this.$getUser()
				let title = "";
				if (options.user_key == user.key) {
					title = "我的回复";
				} else {
					title = result.data.data[0].user.name + "的回复";
				}
				uni.setNavigationBarTitle({title: title});
			} catch (error) {
				
			}
		},
		methods: {
			async fetchPageData() {
				this.options.detail_excerpt = 1;
				let result = await this.$api.listMyComment(this.options);
				return result;
			}
		}
		
	}
</script>

<style>
	
</style>
